package com.weasel.im.common.builder;

import com.weasel.im.common.domain.Message;

/**
 * Created by Dylan on 2015/11/27.
 */
public final class MessageBuilder {

    private Message message = new Message();

    public static MessageBuilder start(){
        return new MessageBuilder();
    }

    public MessageBuilder from(String fromUser){

        message.setFrom(fromUser);
        return this;
    }

    public MessageBuilder to(String toUser){

        message.setTo(toUser);
        return this;
    }

    public MessageBuilder type(Message.Type type){

        message.setType(type);
        return this;
    }

    public MessageBuilder content(Object content){

        message.setContent(content);
        return this;
    }

    public Message build(){
        return message;
    }

    private MessageBuilder(){};
}
